package cn.sciento.transfer.domain.entity;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.choerodon.mybatis.annotation.ModifyAudit;
import io.choerodon.mybatis.annotation.VersionAudit;
import io.choerodon.mybatis.domain.AuditDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.NotBlank;

@ApiModel("待发消息事件")
@VersionAudit
@ModifyAudit
@Table(name = "hdtt_event_send")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class EventSend extends AuditDomain {
  public static final String FIELD_EVENT_ID = "eventId";
  
  public static final String FIELD_EVENT_TYPE = "eventType";
  
  public static final String FIELD_SOURCE_SERVICE = "sourceService";
  
  public static final String FIELD_SOURCE_TABLE = "sourceTable";
  
  public static final String FIELD_PRODUCE_TIME = "produceTime";
  
  public static final String FIELD_MESSAGES = "messages";
  
  public static final String FIELD_PROCESS_STATUS = "processStatus";
  
  public static final String FIELD_PROCESS_MSG = "processMsg";
  
  public static final String FIELD_PROCESS_TIME = "processTime";
  
  @ApiModelProperty("表ID，主键。全局ID")
  @Id
  private Long eventId;
  
  @ApiModelProperty("处理数据租户ID")
  private Long sourceTenantId;
  
  @ApiModelProperty(value = "事件类型", required = true)
  @NotBlank
  private String eventType;
  
  @ApiModelProperty(value = "服务名", required = true)
  @NotBlank
  private String sourceService;
  
  @ApiModelProperty(value = "处理表，也是消息TOPIC", required = true)
  @NotBlank
  private String sourceTable;
  
  @ApiModelProperty(value = "消息产生时间", required = true)
  @NotNull
  private Date produceTime;
  
  @ApiModelProperty("消息内容")
  private String messages;
  
  @ApiModelProperty(value = "处理状态，参考：HDTT.EVENT_PROCESS_STATUS", required = true)
  @NotBlank
  private String processStatus;
  
  @ApiModelProperty("处理消息")
  private String processMsg;
  
  @ApiModelProperty("处理时间")
  private Date processTime;
  
  public Long getEventId() {
    return this.eventId;
  }
  
  public void setEventId(Long eventId) {
    this.eventId = eventId;
  }
  
  public String getEventType() {
    return this.eventType;
  }
  
  public void setEventType(String eventType) {
    this.eventType = eventType;
  }
  
  public String getSourceService() {
    return this.sourceService;
  }
  
  public void setSourceService(String sourceService) {
    this.sourceService = sourceService;
  }
  
  public String getSourceTable() {
    return this.sourceTable;
  }
  
  public void setSourceTable(String sourceTable) {
    this.sourceTable = sourceTable;
  }
  
  public Date getProduceTime() {
    return this.produceTime;
  }
  
  public void setProduceTime(Date produceTime) {
    this.produceTime = produceTime;
  }
  
  public String getMessages() {
    return this.messages;
  }
  
  public void setMessages(String messages) {
    this.messages = messages;
  }
  
  public String getProcessStatus() {
    return this.processStatus;
  }
  
  public void setProcessStatus(String processStatus) {
    this.processStatus = processStatus;
  }
  
  public String getProcessMsg() {
    return this.processMsg;
  }
  
  public void setProcessMsg(String processMsg) {
    this.processMsg = processMsg;
  }
  
  public Date getProcessTime() {
    return this.processTime;
  }
  
  public void setProcessTime(Date processTime) {
    this.processTime = processTime;
  }
  
  public Long getSourceTenantId() {
    return this.sourceTenantId;
  }
  
  public void setSourceTenantId(Long sourceTenantId) {
    this.sourceTenantId = sourceTenantId;
  }
  
  public String toString() {
    return "EventSend{eventId=" + this.eventId + ", sourceTenantId=" + this.sourceTenantId + ", eventType='" + this.eventType + '\'' + ", sourceService='" + this.sourceService + '\'' + ", sourceTable='" + this.sourceTable + '\'' + ", produceTime=" + this.produceTime + ", messages='" + this.messages + '\'' + ", processStatus='" + this.processStatus + '\'' + ", processMsg='" + this.processMsg + '\'' + ", processTime=" + this.processTime + '}';
  }
}
